/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.vportal.portlet.vdoc.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSON;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.util.PortalUtil;

import com.vportal.portlet.vdoc.model.vdocDocument;
import com.vportal.portlet.vdoc.model.vdocDocumentModel;
import com.vportal.portlet.vdoc.model.vdocDocumentSoap;

import java.io.Serializable;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The base model implementation for the vdocDocument service. Represents a row in the &quot;vdocDocument&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.vportal.portlet.vdoc.model.vdocDocumentModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link vdocDocumentImpl}.
 * </p>
 *
 * @author MrEn
 * @see vdocDocumentImpl
 * @see com.vportal.portlet.vdoc.model.vdocDocument
 * @see com.vportal.portlet.vdoc.model.vdocDocumentModel
 * @generated
 */
@JSON(strict = true)
public class vdocDocumentModelImpl extends BaseModelImpl<vdocDocument>
	implements vdocDocumentModel {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this class directly. All methods that expect a vdoc document model instance should use the {@link com.vportal.portlet.vdoc.model.vdocDocument} interface instead.
	 */
	public static final String TABLE_NAME = "vdocDocument";
	public static final Object[][] TABLE_COLUMNS = {
			{ "docId", Types.VARCHAR },
			{ "groupId", Types.BIGINT },
			{ "language", Types.VARCHAR },
			{ "companyId", Types.BIGINT },
			{ "userId", Types.BIGINT },
			{ "createdByUser", Types.BIGINT },
			{ "createdDate", Types.TIMESTAMP },
			{ "modifiedByUser", Types.BIGINT },
			{ "modifiedDate", Types.TIMESTAMP },
			{ "approvedByUser", Types.BIGINT },
			{ "approvedDate", Types.TIMESTAMP },
			{ "publishedByUser", Types.BIGINT },
			{ "publishedDate", Types.TIMESTAMP },
			{ "promulDate", Types.TIMESTAMP },
			{ "effectivedDate", Types.TIMESTAMP },
			{ "expiredDate", Types.TIMESTAMP },
			{ "replaceDoc", Types.VARCHAR },
			{ "title", Types.VARCHAR },
			{ "content", Types.VARCHAR },
			{ "process", Types.VARCHAR },
			{ "base", Types.VARCHAR },
			{ "time_", Types.VARCHAR },
			{ "cost", Types.VARCHAR },
			{ "require", Types.VARCHAR },
			{ "result", Types.VARCHAR },
			{ "objects", Types.VARCHAR },
			{ "style", Types.VARCHAR },
			{ "position", Types.INTEGER },
			{ "note", Types.VARCHAR },
			{ "userHit", Types.INTEGER },
			{ "statusDoc", Types.INTEGER },
			{ "typeDoc", Types.INTEGER },
			{ "hasAttachment", Types.BOOLEAN },
			{ "fieldId", Types.VARCHAR },
			{ "orgRels", Types.VARCHAR },
			{ "fieldRels", Types.VARCHAR }
		};
	public static final String TABLE_SQL_CREATE = "create table vdocDocument (docId VARCHAR(75) not null primary key,groupId LONG,language VARCHAR(75) null,companyId LONG,userId LONG,createdByUser LONG,createdDate DATE null,modifiedByUser LONG,modifiedDate DATE null,approvedByUser LONG,approvedDate DATE null,publishedByUser LONG,publishedDate DATE null,promulDate DATE null,effectivedDate DATE null,expiredDate DATE null,replaceDoc VARCHAR(1000) null,title VARCHAR(1000) null,content TEXT null,process TEXT null,base TEXT null,time_ TEXT null,cost TEXT null,require TEXT null,result TEXT null,objects TEXT null,style TEXT null,position INTEGER,note TEXT null,userHit INTEGER,statusDoc INTEGER,typeDoc INTEGER,hasAttachment BOOLEAN,fieldId VARCHAR(500) null,orgRels VARCHAR(1000) null,fieldRels VARCHAR(1000) null)";
	public static final String TABLE_SQL_DROP = "drop table vdocDocument";
	public static final String ORDER_BY_JPQL = " ORDER BY vdocDocument.position DESC";
	public static final String ORDER_BY_SQL = " ORDER BY vdocDocument.position DESC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.vportal.portlet.vdoc.model.vdocDocument"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.vportal.portlet.vdoc.model.vdocDocument"),
			true);
	public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.column.bitmask.enabled.com.vportal.portlet.vdoc.model.vdocDocument"),
			true);
	public static long DOCID_COLUMN_BITMASK = 1L;
	public static long FIELDID_COLUMN_BITMASK = 2L;
	public static long GROUPID_COLUMN_BITMASK = 4L;
	public static long LANGUAGE_COLUMN_BITMASK = 8L;
	public static long POSITION_COLUMN_BITMASK = 16L;
	public static long STATUSDOC_COLUMN_BITMASK = 32L;
	public static long TYPEDOC_COLUMN_BITMASK = 64L;

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static vdocDocument toModel(vdocDocumentSoap soapModel) {
		vdocDocument model = new vdocDocumentImpl();

		model.setDocId(soapModel.getDocId());
		model.setGroupId(soapModel.getGroupId());
		model.setLanguage(soapModel.getLanguage());
		model.setCompanyId(soapModel.getCompanyId());
		model.setUserId(soapModel.getUserId());
		model.setCreatedByUser(soapModel.getCreatedByUser());
		model.setCreatedDate(soapModel.getCreatedDate());
		model.setModifiedByUser(soapModel.getModifiedByUser());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setApprovedByUser(soapModel.getApprovedByUser());
		model.setApprovedDate(soapModel.getApprovedDate());
		model.setPublishedByUser(soapModel.getPublishedByUser());
		model.setPublishedDate(soapModel.getPublishedDate());
		model.setPromulDate(soapModel.getPromulDate());
		model.setEffectivedDate(soapModel.getEffectivedDate());
		model.setExpiredDate(soapModel.getExpiredDate());
		model.setReplaceDoc(soapModel.getReplaceDoc());
		model.setTitle(soapModel.getTitle());
		model.setContent(soapModel.getContent());
		model.setProcess(soapModel.getProcess());
		model.setBase(soapModel.getBase());
		model.setTime(soapModel.getTime());
		model.setCost(soapModel.getCost());
		model.setRequire(soapModel.getRequire());
		model.setResult(soapModel.getResult());
		model.setObjects(soapModel.getObjects());
		model.setStyle(soapModel.getStyle());
		model.setPosition(soapModel.getPosition());
		model.setNote(soapModel.getNote());
		model.setUserHit(soapModel.getUserHit());
		model.setStatusDoc(soapModel.getStatusDoc());
		model.setTypeDoc(soapModel.getTypeDoc());
		model.setHasAttachment(soapModel.getHasAttachment());
		model.setFieldId(soapModel.getFieldId());
		model.setOrgRels(soapModel.getOrgRels());
		model.setFieldRels(soapModel.getFieldRels());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<vdocDocument> toModels(vdocDocumentSoap[] soapModels) {
		List<vdocDocument> models = new ArrayList<vdocDocument>(soapModels.length);

		for (vdocDocumentSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.vportal.portlet.vdoc.model.vdocDocument"));

	public vdocDocumentModelImpl() {
	}

	public String getPrimaryKey() {
		return _docId;
	}

	public void setPrimaryKey(String primaryKey) {
		setDocId(primaryKey);
	}

	public Serializable getPrimaryKeyObj() {
		return _docId;
	}

	public void setPrimaryKeyObj(Serializable primaryKeyObj) {
		setPrimaryKey((String)primaryKeyObj);
	}

	public Class<?> getModelClass() {
		return vdocDocument.class;
	}

	public String getModelClassName() {
		return vdocDocument.class.getName();
	}

	@JSON
	public String getDocId() {
		if (_docId == null) {
			return StringPool.BLANK;
		}
		else {
			return _docId;
		}
	}

	public void setDocId(String docId) {
		_columnBitmask |= DOCID_COLUMN_BITMASK;

		if (_originalDocId == null) {
			_originalDocId = _docId;
		}

		_docId = docId;
	}

	public String getOriginalDocId() {
		return GetterUtil.getString(_originalDocId);
	}

	@JSON
	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_columnBitmask |= GROUPID_COLUMN_BITMASK;

		if (!_setOriginalGroupId) {
			_setOriginalGroupId = true;

			_originalGroupId = _groupId;
		}

		_groupId = groupId;
	}

	public long getOriginalGroupId() {
		return _originalGroupId;
	}

	@JSON
	public String getLanguage() {
		if (_language == null) {
			return StringPool.BLANK;
		}
		else {
			return _language;
		}
	}

	public void setLanguage(String language) {
		_columnBitmask |= LANGUAGE_COLUMN_BITMASK;

		if (_originalLanguage == null) {
			_originalLanguage = _language;
		}

		_language = language;
	}

	public String getOriginalLanguage() {
		return GetterUtil.getString(_originalLanguage);
	}

	@JSON
	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	@JSON
	public long getUserId() {
		return _userId;
	}

	public void setUserId(long userId) {
		_userId = userId;
	}

	public String getUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
	}

	public void setUserUuid(String userUuid) {
		_userUuid = userUuid;
	}

	@JSON
	public long getCreatedByUser() {
		return _createdByUser;
	}

	public void setCreatedByUser(long createdByUser) {
		_createdByUser = createdByUser;
	}

	@JSON
	public Date getCreatedDate() {
		return _createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		_createdDate = createdDate;
	}

	@JSON
	public long getModifiedByUser() {
		return _modifiedByUser;
	}

	public void setModifiedByUser(long modifiedByUser) {
		_modifiedByUser = modifiedByUser;
	}

	@JSON
	public Date getModifiedDate() {
		return _modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		_modifiedDate = modifiedDate;
	}

	@JSON
	public long getApprovedByUser() {
		return _approvedByUser;
	}

	public void setApprovedByUser(long approvedByUser) {
		_approvedByUser = approvedByUser;
	}

	@JSON
	public Date getApprovedDate() {
		return _approvedDate;
	}

	public void setApprovedDate(Date approvedDate) {
		_approvedDate = approvedDate;
	}

	@JSON
	public long getPublishedByUser() {
		return _publishedByUser;
	}

	public void setPublishedByUser(long publishedByUser) {
		_publishedByUser = publishedByUser;
	}

	@JSON
	public Date getPublishedDate() {
		return _publishedDate;
	}

	public void setPublishedDate(Date publishedDate) {
		_publishedDate = publishedDate;
	}

	@JSON
	public Date getPromulDate() {
		return _promulDate;
	}

	public void setPromulDate(Date promulDate) {
		_promulDate = promulDate;
	}

	@JSON
	public Date getEffectivedDate() {
		return _effectivedDate;
	}

	public void setEffectivedDate(Date effectivedDate) {
		_effectivedDate = effectivedDate;
	}

	@JSON
	public Date getExpiredDate() {
		return _expiredDate;
	}

	public void setExpiredDate(Date expiredDate) {
		_expiredDate = expiredDate;
	}

	@JSON
	public String getReplaceDoc() {
		if (_replaceDoc == null) {
			return StringPool.BLANK;
		}
		else {
			return _replaceDoc;
		}
	}

	public void setReplaceDoc(String replaceDoc) {
		_replaceDoc = replaceDoc;
	}

	@JSON
	public String getTitle() {
		if (_title == null) {
			return StringPool.BLANK;
		}
		else {
			return _title;
		}
	}

	public void setTitle(String title) {
		_title = title;
	}

	@JSON
	public String getContent() {
		if (_content == null) {
			return StringPool.BLANK;
		}
		else {
			return _content;
		}
	}

	public void setContent(String content) {
		_content = content;
	}

	@JSON
	public String getProcess() {
		if (_process == null) {
			return StringPool.BLANK;
		}
		else {
			return _process;
		}
	}

	public void setProcess(String process) {
		_process = process;
	}

	@JSON
	public String getBase() {
		if (_base == null) {
			return StringPool.BLANK;
		}
		else {
			return _base;
		}
	}

	public void setBase(String base) {
		_base = base;
	}

	@JSON
	public String getTime() {
		if (_time == null) {
			return StringPool.BLANK;
		}
		else {
			return _time;
		}
	}

	public void setTime(String time) {
		_time = time;
	}

	@JSON
	public String getCost() {
		if (_cost == null) {
			return StringPool.BLANK;
		}
		else {
			return _cost;
		}
	}

	public void setCost(String cost) {
		_cost = cost;
	}

	@JSON
	public String getRequire() {
		if (_require == null) {
			return StringPool.BLANK;
		}
		else {
			return _require;
		}
	}

	public void setRequire(String require) {
		_require = require;
	}

	@JSON
	public String getResult() {
		if (_result == null) {
			return StringPool.BLANK;
		}
		else {
			return _result;
		}
	}

	public void setResult(String result) {
		_result = result;
	}

	@JSON
	public String getObjects() {
		if (_objects == null) {
			return StringPool.BLANK;
		}
		else {
			return _objects;
		}
	}

	public void setObjects(String objects) {
		_objects = objects;
	}

	@JSON
	public String getStyle() {
		if (_style == null) {
			return StringPool.BLANK;
		}
		else {
			return _style;
		}
	}

	public void setStyle(String style) {
		_style = style;
	}

	@JSON
	public int getPosition() {
		return _position;
	}

	public void setPosition(int position) {
		_columnBitmask = -1L;

		if (!_setOriginalPosition) {
			_setOriginalPosition = true;

			_originalPosition = _position;
		}

		_position = position;
	}

	public int getOriginalPosition() {
		return _originalPosition;
	}

	@JSON
	public String getNote() {
		if (_note == null) {
			return StringPool.BLANK;
		}
		else {
			return _note;
		}
	}

	public void setNote(String note) {
		_note = note;
	}

	@JSON
	public int getUserHit() {
		return _userHit;
	}

	public void setUserHit(int userHit) {
		_userHit = userHit;
	}

	@JSON
	public int getStatusDoc() {
		return _statusDoc;
	}

	public void setStatusDoc(int statusDoc) {
		_columnBitmask |= STATUSDOC_COLUMN_BITMASK;

		if (!_setOriginalStatusDoc) {
			_setOriginalStatusDoc = true;

			_originalStatusDoc = _statusDoc;
		}

		_statusDoc = statusDoc;
	}

	public int getOriginalStatusDoc() {
		return _originalStatusDoc;
	}

	@JSON
	public int getTypeDoc() {
		return _typeDoc;
	}

	public void setTypeDoc(int typeDoc) {
		_columnBitmask |= TYPEDOC_COLUMN_BITMASK;

		if (!_setOriginalTypeDoc) {
			_setOriginalTypeDoc = true;

			_originalTypeDoc = _typeDoc;
		}

		_typeDoc = typeDoc;
	}

	public int getOriginalTypeDoc() {
		return _originalTypeDoc;
	}

	@JSON
	public boolean getHasAttachment() {
		return _hasAttachment;
	}

	public boolean isHasAttachment() {
		return _hasAttachment;
	}

	public void setHasAttachment(boolean hasAttachment) {
		_hasAttachment = hasAttachment;
	}

	@JSON
	public String getFieldId() {
		if (_fieldId == null) {
			return StringPool.BLANK;
		}
		else {
			return _fieldId;
		}
	}

	public void setFieldId(String fieldId) {
		_columnBitmask |= FIELDID_COLUMN_BITMASK;

		if (_originalFieldId == null) {
			_originalFieldId = _fieldId;
		}

		_fieldId = fieldId;
	}

	public String getOriginalFieldId() {
		return GetterUtil.getString(_originalFieldId);
	}

	@JSON
	public String getOrgRels() {
		if (_orgRels == null) {
			return StringPool.BLANK;
		}
		else {
			return _orgRels;
		}
	}

	public void setOrgRels(String orgRels) {
		_orgRels = orgRels;
	}

	@JSON
	public String getFieldRels() {
		if (_fieldRels == null) {
			return StringPool.BLANK;
		}
		else {
			return _fieldRels;
		}
	}

	public void setFieldRels(String fieldRels) {
		_fieldRels = fieldRels;
	}

	public long getColumnBitmask() {
		return _columnBitmask;
	}

	@Override
	public vdocDocument toEscapedModel() {
		if (_escapedModelProxy == null) {
			_escapedModelProxy = (vdocDocument)ProxyUtil.newProxyInstance(_classLoader,
					_escapedModelProxyInterfaces,
					new AutoEscapeBeanHandler(this));
		}

		return _escapedModelProxy;
	}

	@Override
	public Object clone() {
		vdocDocumentImpl vdocDocumentImpl = new vdocDocumentImpl();

		vdocDocumentImpl.setDocId(getDocId());
		vdocDocumentImpl.setGroupId(getGroupId());
		vdocDocumentImpl.setLanguage(getLanguage());
		vdocDocumentImpl.setCompanyId(getCompanyId());
		vdocDocumentImpl.setUserId(getUserId());
		vdocDocumentImpl.setCreatedByUser(getCreatedByUser());
		vdocDocumentImpl.setCreatedDate(getCreatedDate());
		vdocDocumentImpl.setModifiedByUser(getModifiedByUser());
		vdocDocumentImpl.setModifiedDate(getModifiedDate());
		vdocDocumentImpl.setApprovedByUser(getApprovedByUser());
		vdocDocumentImpl.setApprovedDate(getApprovedDate());
		vdocDocumentImpl.setPublishedByUser(getPublishedByUser());
		vdocDocumentImpl.setPublishedDate(getPublishedDate());
		vdocDocumentImpl.setPromulDate(getPromulDate());
		vdocDocumentImpl.setEffectivedDate(getEffectivedDate());
		vdocDocumentImpl.setExpiredDate(getExpiredDate());
		vdocDocumentImpl.setReplaceDoc(getReplaceDoc());
		vdocDocumentImpl.setTitle(getTitle());
		vdocDocumentImpl.setContent(getContent());
		vdocDocumentImpl.setProcess(getProcess());
		vdocDocumentImpl.setBase(getBase());
		vdocDocumentImpl.setTime(getTime());
		vdocDocumentImpl.setCost(getCost());
		vdocDocumentImpl.setRequire(getRequire());
		vdocDocumentImpl.setResult(getResult());
		vdocDocumentImpl.setObjects(getObjects());
		vdocDocumentImpl.setStyle(getStyle());
		vdocDocumentImpl.setPosition(getPosition());
		vdocDocumentImpl.setNote(getNote());
		vdocDocumentImpl.setUserHit(getUserHit());
		vdocDocumentImpl.setStatusDoc(getStatusDoc());
		vdocDocumentImpl.setTypeDoc(getTypeDoc());
		vdocDocumentImpl.setHasAttachment(getHasAttachment());
		vdocDocumentImpl.setFieldId(getFieldId());
		vdocDocumentImpl.setOrgRels(getOrgRels());
		vdocDocumentImpl.setFieldRels(getFieldRels());

		vdocDocumentImpl.resetOriginalValues();

		return vdocDocumentImpl;
	}

	public int compareTo(vdocDocument vdocDocument) {
		int value = 0;

		if (getPosition() < vdocDocument.getPosition()) {
			value = -1;
		}
		else if (getPosition() > vdocDocument.getPosition()) {
			value = 1;
		}
		else {
			value = 0;
		}

		value = value * -1;

		if (value != 0) {
			return value;
		}

		return 0;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		vdocDocument vdocDocument = null;

		try {
			vdocDocument = (vdocDocument)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String primaryKey = vdocDocument.getPrimaryKey();

		if (getPrimaryKey().equals(primaryKey)) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	@Override
	public void resetOriginalValues() {
		vdocDocumentModelImpl vdocDocumentModelImpl = this;

		vdocDocumentModelImpl._originalDocId = vdocDocumentModelImpl._docId;

		vdocDocumentModelImpl._originalGroupId = vdocDocumentModelImpl._groupId;

		vdocDocumentModelImpl._setOriginalGroupId = false;

		vdocDocumentModelImpl._originalLanguage = vdocDocumentModelImpl._language;

		vdocDocumentModelImpl._originalPosition = vdocDocumentModelImpl._position;

		vdocDocumentModelImpl._setOriginalPosition = false;

		vdocDocumentModelImpl._originalStatusDoc = vdocDocumentModelImpl._statusDoc;

		vdocDocumentModelImpl._setOriginalStatusDoc = false;

		vdocDocumentModelImpl._originalTypeDoc = vdocDocumentModelImpl._typeDoc;

		vdocDocumentModelImpl._setOriginalTypeDoc = false;

		vdocDocumentModelImpl._originalFieldId = vdocDocumentModelImpl._fieldId;

		vdocDocumentModelImpl._columnBitmask = 0;
	}

	@Override
	public CacheModel<vdocDocument> toCacheModel() {
		vdocDocumentCacheModel vdocDocumentCacheModel = new vdocDocumentCacheModel();

		vdocDocumentCacheModel.docId = getDocId();

		String docId = vdocDocumentCacheModel.docId;

		if ((docId != null) && (docId.length() == 0)) {
			vdocDocumentCacheModel.docId = null;
		}

		vdocDocumentCacheModel.groupId = getGroupId();

		vdocDocumentCacheModel.language = getLanguage();

		String language = vdocDocumentCacheModel.language;

		if ((language != null) && (language.length() == 0)) {
			vdocDocumentCacheModel.language = null;
		}

		vdocDocumentCacheModel.companyId = getCompanyId();

		vdocDocumentCacheModel.userId = getUserId();

		vdocDocumentCacheModel.createdByUser = getCreatedByUser();

		Date createdDate = getCreatedDate();

		if (createdDate != null) {
			vdocDocumentCacheModel.createdDate = createdDate.getTime();
		}
		else {
			vdocDocumentCacheModel.createdDate = Long.MIN_VALUE;
		}

		vdocDocumentCacheModel.modifiedByUser = getModifiedByUser();

		Date modifiedDate = getModifiedDate();

		if (modifiedDate != null) {
			vdocDocumentCacheModel.modifiedDate = modifiedDate.getTime();
		}
		else {
			vdocDocumentCacheModel.modifiedDate = Long.MIN_VALUE;
		}

		vdocDocumentCacheModel.approvedByUser = getApprovedByUser();

		Date approvedDate = getApprovedDate();

		if (approvedDate != null) {
			vdocDocumentCacheModel.approvedDate = approvedDate.getTime();
		}
		else {
			vdocDocumentCacheModel.approvedDate = Long.MIN_VALUE;
		}

		vdocDocumentCacheModel.publishedByUser = getPublishedByUser();

		Date publishedDate = getPublishedDate();

		if (publishedDate != null) {
			vdocDocumentCacheModel.publishedDate = publishedDate.getTime();
		}
		else {
			vdocDocumentCacheModel.publishedDate = Long.MIN_VALUE;
		}

		Date promulDate = getPromulDate();

		if (promulDate != null) {
			vdocDocumentCacheModel.promulDate = promulDate.getTime();
		}
		else {
			vdocDocumentCacheModel.promulDate = Long.MIN_VALUE;
		}

		Date effectivedDate = getEffectivedDate();

		if (effectivedDate != null) {
			vdocDocumentCacheModel.effectivedDate = effectivedDate.getTime();
		}
		else {
			vdocDocumentCacheModel.effectivedDate = Long.MIN_VALUE;
		}

		Date expiredDate = getExpiredDate();

		if (expiredDate != null) {
			vdocDocumentCacheModel.expiredDate = expiredDate.getTime();
		}
		else {
			vdocDocumentCacheModel.expiredDate = Long.MIN_VALUE;
		}

		vdocDocumentCacheModel.replaceDoc = getReplaceDoc();

		String replaceDoc = vdocDocumentCacheModel.replaceDoc;

		if ((replaceDoc != null) && (replaceDoc.length() == 0)) {
			vdocDocumentCacheModel.replaceDoc = null;
		}

		vdocDocumentCacheModel.title = getTitle();

		String title = vdocDocumentCacheModel.title;

		if ((title != null) && (title.length() == 0)) {
			vdocDocumentCacheModel.title = null;
		}

		vdocDocumentCacheModel.content = getContent();

		String content = vdocDocumentCacheModel.content;

		if ((content != null) && (content.length() == 0)) {
			vdocDocumentCacheModel.content = null;
		}

		vdocDocumentCacheModel.process = getProcess();

		String process = vdocDocumentCacheModel.process;

		if ((process != null) && (process.length() == 0)) {
			vdocDocumentCacheModel.process = null;
		}

		vdocDocumentCacheModel.base = getBase();

		String base = vdocDocumentCacheModel.base;

		if ((base != null) && (base.length() == 0)) {
			vdocDocumentCacheModel.base = null;
		}

		vdocDocumentCacheModel.time = getTime();

		String time = vdocDocumentCacheModel.time;

		if ((time != null) && (time.length() == 0)) {
			vdocDocumentCacheModel.time = null;
		}

		vdocDocumentCacheModel.cost = getCost();

		String cost = vdocDocumentCacheModel.cost;

		if ((cost != null) && (cost.length() == 0)) {
			vdocDocumentCacheModel.cost = null;
		}

		vdocDocumentCacheModel.require = getRequire();

		String require = vdocDocumentCacheModel.require;

		if ((require != null) && (require.length() == 0)) {
			vdocDocumentCacheModel.require = null;
		}

		vdocDocumentCacheModel.result = getResult();

		String result = vdocDocumentCacheModel.result;

		if ((result != null) && (result.length() == 0)) {
			vdocDocumentCacheModel.result = null;
		}

		vdocDocumentCacheModel.objects = getObjects();

		String objects = vdocDocumentCacheModel.objects;

		if ((objects != null) && (objects.length() == 0)) {
			vdocDocumentCacheModel.objects = null;
		}

		vdocDocumentCacheModel.style = getStyle();

		String style = vdocDocumentCacheModel.style;

		if ((style != null) && (style.length() == 0)) {
			vdocDocumentCacheModel.style = null;
		}

		vdocDocumentCacheModel.position = getPosition();

		vdocDocumentCacheModel.note = getNote();

		String note = vdocDocumentCacheModel.note;

		if ((note != null) && (note.length() == 0)) {
			vdocDocumentCacheModel.note = null;
		}

		vdocDocumentCacheModel.userHit = getUserHit();

		vdocDocumentCacheModel.statusDoc = getStatusDoc();

		vdocDocumentCacheModel.typeDoc = getTypeDoc();

		vdocDocumentCacheModel.hasAttachment = getHasAttachment();

		vdocDocumentCacheModel.fieldId = getFieldId();

		String fieldId = vdocDocumentCacheModel.fieldId;

		if ((fieldId != null) && (fieldId.length() == 0)) {
			vdocDocumentCacheModel.fieldId = null;
		}

		vdocDocumentCacheModel.orgRels = getOrgRels();

		String orgRels = vdocDocumentCacheModel.orgRels;

		if ((orgRels != null) && (orgRels.length() == 0)) {
			vdocDocumentCacheModel.orgRels = null;
		}

		vdocDocumentCacheModel.fieldRels = getFieldRels();

		String fieldRels = vdocDocumentCacheModel.fieldRels;

		if ((fieldRels != null) && (fieldRels.length() == 0)) {
			vdocDocumentCacheModel.fieldRels = null;
		}

		return vdocDocumentCacheModel;
	}

	@Override
	public String toString() {
		StringBundler sb = new StringBundler(73);

		sb.append("{docId=");
		sb.append(getDocId());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", language=");
		sb.append(getLanguage());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", createdByUser=");
		sb.append(getCreatedByUser());
		sb.append(", createdDate=");
		sb.append(getCreatedDate());
		sb.append(", modifiedByUser=");
		sb.append(getModifiedByUser());
		sb.append(", modifiedDate=");
		sb.append(getModifiedDate());
		sb.append(", approvedByUser=");
		sb.append(getApprovedByUser());
		sb.append(", approvedDate=");
		sb.append(getApprovedDate());
		sb.append(", publishedByUser=");
		sb.append(getPublishedByUser());
		sb.append(", publishedDate=");
		sb.append(getPublishedDate());
		sb.append(", promulDate=");
		sb.append(getPromulDate());
		sb.append(", effectivedDate=");
		sb.append(getEffectivedDate());
		sb.append(", expiredDate=");
		sb.append(getExpiredDate());
		sb.append(", replaceDoc=");
		sb.append(getReplaceDoc());
		sb.append(", title=");
		sb.append(getTitle());
		sb.append(", content=");
		sb.append(getContent());
		sb.append(", process=");
		sb.append(getProcess());
		sb.append(", base=");
		sb.append(getBase());
		sb.append(", time=");
		sb.append(getTime());
		sb.append(", cost=");
		sb.append(getCost());
		sb.append(", require=");
		sb.append(getRequire());
		sb.append(", result=");
		sb.append(getResult());
		sb.append(", objects=");
		sb.append(getObjects());
		sb.append(", style=");
		sb.append(getStyle());
		sb.append(", position=");
		sb.append(getPosition());
		sb.append(", note=");
		sb.append(getNote());
		sb.append(", userHit=");
		sb.append(getUserHit());
		sb.append(", statusDoc=");
		sb.append(getStatusDoc());
		sb.append(", typeDoc=");
		sb.append(getTypeDoc());
		sb.append(", hasAttachment=");
		sb.append(getHasAttachment());
		sb.append(", fieldId=");
		sb.append(getFieldId());
		sb.append(", orgRels=");
		sb.append(getOrgRels());
		sb.append(", fieldRels=");
		sb.append(getFieldRels());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(112);

		sb.append("<model><model-name>");
		sb.append("com.vportal.portlet.vdoc.model.vdocDocument");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>docId</column-name><column-value><![CDATA[");
		sb.append(getDocId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>language</column-name><column-value><![CDATA[");
		sb.append(getLanguage());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createdByUser</column-name><column-value><![CDATA[");
		sb.append(getCreatedByUser());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createdDate</column-name><column-value><![CDATA[");
		sb.append(getCreatedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedByUser</column-name><column-value><![CDATA[");
		sb.append(getModifiedByUser());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
		sb.append(getModifiedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>approvedByUser</column-name><column-value><![CDATA[");
		sb.append(getApprovedByUser());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>approvedDate</column-name><column-value><![CDATA[");
		sb.append(getApprovedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>publishedByUser</column-name><column-value><![CDATA[");
		sb.append(getPublishedByUser());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>publishedDate</column-name><column-value><![CDATA[");
		sb.append(getPublishedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>promulDate</column-name><column-value><![CDATA[");
		sb.append(getPromulDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>effectivedDate</column-name><column-value><![CDATA[");
		sb.append(getEffectivedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>expiredDate</column-name><column-value><![CDATA[");
		sb.append(getExpiredDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>replaceDoc</column-name><column-value><![CDATA[");
		sb.append(getReplaceDoc());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>title</column-name><column-value><![CDATA[");
		sb.append(getTitle());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>content</column-name><column-value><![CDATA[");
		sb.append(getContent());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>process</column-name><column-value><![CDATA[");
		sb.append(getProcess());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>base</column-name><column-value><![CDATA[");
		sb.append(getBase());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>time</column-name><column-value><![CDATA[");
		sb.append(getTime());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>cost</column-name><column-value><![CDATA[");
		sb.append(getCost());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>require</column-name><column-value><![CDATA[");
		sb.append(getRequire());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>result</column-name><column-value><![CDATA[");
		sb.append(getResult());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>objects</column-name><column-value><![CDATA[");
		sb.append(getObjects());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>style</column-name><column-value><![CDATA[");
		sb.append(getStyle());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>position</column-name><column-value><![CDATA[");
		sb.append(getPosition());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>note</column-name><column-value><![CDATA[");
		sb.append(getNote());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userHit</column-name><column-value><![CDATA[");
		sb.append(getUserHit());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>statusDoc</column-name><column-value><![CDATA[");
		sb.append(getStatusDoc());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>typeDoc</column-name><column-value><![CDATA[");
		sb.append(getTypeDoc());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>hasAttachment</column-name><column-value><![CDATA[");
		sb.append(getHasAttachment());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fieldId</column-name><column-value><![CDATA[");
		sb.append(getFieldId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>orgRels</column-name><column-value><![CDATA[");
		sb.append(getOrgRels());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fieldRels</column-name><column-value><![CDATA[");
		sb.append(getFieldRels());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private static ClassLoader _classLoader = vdocDocument.class.getClassLoader();
	private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
			vdocDocument.class
		};
	private String _docId;
	private String _originalDocId;
	private long _groupId;
	private long _originalGroupId;
	private boolean _setOriginalGroupId;
	private String _language;
	private String _originalLanguage;
	private long _companyId;
	private long _userId;
	private String _userUuid;
	private long _createdByUser;
	private Date _createdDate;
	private long _modifiedByUser;
	private Date _modifiedDate;
	private long _approvedByUser;
	private Date _approvedDate;
	private long _publishedByUser;
	private Date _publishedDate;
	private Date _promulDate;
	private Date _effectivedDate;
	private Date _expiredDate;
	private String _replaceDoc;
	private String _title;
	private String _content;
	private String _process;
	private String _base;
	private String _time;
	private String _cost;
	private String _require;
	private String _result;
	private String _objects;
	private String _style;
	private int _position;
	private int _originalPosition;
	private boolean _setOriginalPosition;
	private String _note;
	private int _userHit;
	private int _statusDoc;
	private int _originalStatusDoc;
	private boolean _setOriginalStatusDoc;
	private int _typeDoc;
	private int _originalTypeDoc;
	private boolean _setOriginalTypeDoc;
	private boolean _hasAttachment;
	private String _fieldId;
	private String _originalFieldId;
	private String _orgRels;
	private String _fieldRels;
	private long _columnBitmask;
	private vdocDocument _escapedModelProxy;
}